package com.study.controller.config;

import com.study.controller.entity.Car;
import com.study.controller.entity.Cat;
import com.study.controller.entity.Person;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

import java.util.HashMap;
import java.util.Map;

/**
 * @author CKC
 * @DateTime 2021/11/23 20:32
 */
@Configuration
public class SpringBootConfig {
    
    @Bean
    public Person person() {
        return new Person("kechen", 23);
    }
    
    @Bean
    public Cat cat() {
        return new Cat("Cat", 12);
    }
    
    @Bean
    public Car car() {
        return new Car("Cat", 12);
    }
    
    @Bean
    public RestTemplate restTemplate() {
        RestTemplate template = new RestTemplate();
        Map<String, String> map = new HashMap<>();
        map.put("heihei", "123");
        
        template.setDefaultUriVariables(map);
        return template;
    }
}
